﻿namespace Zocono.WCS.Admin.Models.Comm
{
    /// <summary>
    /// 返回公共参数
    /// </summary>
    public class ApiResult
    {
        public ApiResult()
        {

        }
        /// <summary>
        /// 结果，成功与否
        /// </summary>
        public bool Result { get; set; }

        /// <summary>
        /// 结果编码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        public string Message { get; set; }
        public ApiResult(bool result, string message)
        {
            Result = result;
            Message = message;
        }
        public ApiResult(bool result, string code, string message)
        {
            Result = result;
            Message = message;
            Code = code;
        }

    }
    public class ApiResult<T> : ApiResult
    {
        public ApiResult() { }

        public ApiResult(bool result, string message, T _data) : base(result, message)
        {
            Data = _data;
        }

        public ApiResult(bool result, string code, string message, T _data) : base(result, code, message)
        {
            Data = _data;
        }

        public T Data { get; set; }
    }
}
